<html>  
  <head><title>YQL and RSS: Yahoo! Top News Stories</title>  
  <style type='text/css'>  
    #results{
    	width: 85%;
    	border: 1px solid gray;
    	height: 100%;
    	overflow: auto;
    
    }   
  </style>  
  <script type='text/javascript'>  
    // Parses returned response and extracts  
    // the title, links, and text of each news story.  
    function top_stories(o){  
      var items = o.query.results.item;  
      var output = '';  
      //Get number of items
      var no_items=items.length;  
      for(var i=0;i<no_items;i++){  
        var title = items[i].title;  
        var link = items[i].link;  
        var desc = items[i].description;  
        output += "<h3><a href='" + link + "'>"+title+"</a></h3>" + desc + "<hr/>";  
      }  
      // Place news stories in div tag  
      document.getElementById('results').innerHTML = output;    
    }
    </script>  
  </head>  
  <body>  
    <!-- Div tag for stories results -->  
    <div id='results'></div>  
    <!-- The YQL statment will be assigned to src. -->  
      
  <!-- &callback=top_stories -->
    <script src='http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20rss%20where%20url%3D%22http%3A%2F%2Frss.news.yahoo.com%2Frss%2Ftopstories%22&format=json?&callback=top_stories'></script>  
  </body>  
</html>